package org.rcy.framework.job.elastic.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(
        prefix = JobProperties.PREFIX
)
public class JobProperties {
    public static final String PREFIX = "elastic-job";
    private String namespace = "jobs";
    private String zkConnectString = "127.0.0.1:2181";
    private String consulConnectString = "127.0.0.1:8500";
    private int maxRetries = 3;
    private boolean disabled = true;
    private boolean disabledOverwrite = false;
    private boolean cleanServerOnShutdown = true;
    private boolean cleanUnavailableServers = false;
    private String cleanUnavailableServersCron = "0 0 6 * * ?";

    public JobProperties() {
    }

    public String getNamespace() {
        return this.namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getZkConnectString() {
        return this.zkConnectString;
    }

    public void setZkConnectString(String zkConnectString) {
        this.zkConnectString = zkConnectString;
    }

    public int getMaxRetries() {
        return this.maxRetries;
    }

    public void setMaxRetries(int maxRetries) {
        this.maxRetries = maxRetries;
    }

    public boolean isDisabled() {
        return this.disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public boolean isCleanUnavailableServers() {
        return this.cleanUnavailableServers;
    }

    public void setCleanUnavailableServers(boolean cleanUnavailableServers) {
        this.cleanUnavailableServers = cleanUnavailableServers;
    }

    public String getCleanUnavailableServersCron() {
        return this.cleanUnavailableServersCron;
    }

    public void setCleanUnavailableServersCron(String cleanUnavailableServersCron) {
        this.cleanUnavailableServersCron = cleanUnavailableServersCron;
    }

    public boolean isCleanServerOnShutdown() {
        return this.cleanServerOnShutdown;
    }

    public void setCleanServerOnShutdown(boolean cleanServerOnShutdown) {
        this.cleanServerOnShutdown = cleanServerOnShutdown;
    }

    public boolean isDisabledOverwrite() {
        return this.disabledOverwrite;
    }

    public void setDisabledOverwrite(boolean disabledOverwrite) {
        this.disabledOverwrite = disabledOverwrite;
    }
}
